package com.shensi.adminCollect.service.device.impl;

import com.shensi.adminCollect.common.utils.DateUtils;
import com.shensi.adminCollect.domain.device.DeviceSync;
import com.shensi.adminCollect.mapper.device.DeviceSyncMapper;
import com.shensi.adminCollect.service.device.IDeviceSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * 双屏机同步Service业务层处理
 * 
 * @author joeley
 * @date 2022-12-23
 */


@Service
public class DeviceSyncServiceImpl implements IDeviceSyncService 
{
    @Autowired
    private DeviceSyncMapper deviceSyncMapper;

    /**
     * 查询双屏机同步
     * 
     * @param id 双屏机同步主键
     * @return 双屏机同步
     */
    @Override
    public DeviceSync selectDeviceSyncById(Long id)
    {
        return deviceSyncMapper.selectDeviceSyncById(id);
    }

    /**
     * 查询双屏机同步列表
     * 
     * @param deviceSync 双屏机同步
     * @return 双屏机同步
     */
    @Override
    public List<DeviceSync> selectDeviceSyncList(DeviceSync deviceSync)
    {
        return deviceSyncMapper.selectDeviceSyncList(deviceSync);
    }

    /**
     * 新增双屏机同步
     * 
     * @param deviceSync 双屏机同步
     * @return 结果
     */
    @Override
    public int insertDeviceSync(DeviceSync deviceSync)
    {
        deviceSync.setCreateTime(DateUtils.getNowDate());
        return deviceSyncMapper.insertDeviceSync(deviceSync);
    }

    /**
     * 修改双屏机同步
     * 
     * @param deviceSync 双屏机同步
     * @return 结果
     */
    @Override
    public int updateDeviceSync(DeviceSync deviceSync)
    {
        return deviceSyncMapper.updateDeviceSync(deviceSync);
    }

    /**
     * 批量删除双屏机同步
     * 
     * @param ids 需要删除的双屏机同步主键
     * @return 结果
     */
    @Override
    public int deleteDeviceSyncByIds(Long[] ids)
    {
        return deviceSyncMapper.deleteDeviceSyncByIds(ids);
    }

    /**
     * 删除双屏机同步信息
     * 
     * @param id 双屏机同步主键
     * @return 结果
     */
    @Override
    public int deleteDeviceSyncById(Long id)
    {
        return deviceSyncMapper.deleteDeviceSyncById(id);
    }

    public List<DeviceSync> selectDeviceSyncListWithCreatetimeOrder(DeviceSync deviceSync){
        return deviceSyncMapper.selectDeviceSyncListWithCreatetimeOrder(deviceSync);
    };

    public Date selectDeviceSyncListToGetMaxCreatetime(DeviceSync deviceSync){
        return deviceSyncMapper.selectDeviceSyncListToGetMaxCreatetime(deviceSync);
    };


}
